<%--
  Created by IntelliJ IDEA.
  User: Think
  Date: 2024/7/22
  Time: 下午10:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>For 循环</title>
</head>
<body>
<h1>For 循环</h1>

<%
    for (int f=1;f<=7;f++){
%>
<%! String color = "white";%>
<%switch (f){
    case 1:
        color="red";
        break;
    case 2:
        color="orange";
        break;
    case 3:
        color="yellow";
        break;
    case 4:
        color="green";
        break;
    case 5:
        color="blue";
        break;
    case 6:
        color="indigo";
        break;
    case 7:
        color="violet";
        break;
}%>
<div style="color:<%=color%>">钟定山</div>
<%
}
%>
</body>
</html>
